"""
集合：
    可变集合   set()
    不可变集合   fornzenset()
"""

data_01 = "aaaaaaaahhhhhhhbnbnbbb"
new_data_01 = set(data_01)
print(new_data_01)

data_02 = ["nginx","tomcat","nginx","git","nginx"]
new_data_02 = frozenset(data_02)
print(new_data_02)

# 通过for循环遍历集合
for i in new_data_02:
    print("---->%s" % i)

#示例1：
# 输出一下每个字符的次数
data_03 = "aaaaaaaaahhhhaaaahhhccccbbbbccrrrrrr"
for i in set(data_03):
    print("字符：%s, 次数：%d" % (i, data_03.count(i)))
#示例2:
data_04 = ("10.11.2.1","192.0.3.2","10.11.2.1")
for i in set(data_04):
    print("IP地址: %s,次数: %s" % (i, data_04.count(i)))




